package com.heima.admin.controller.v1;

import com.heima.admin.service.AdUserService;
import com.heima.model.admin.dtos.AdUserDto;
import com.heima.model.admin.dtos.AuthDto;
import com.heima.model.admin.pojos.AdUser;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUserRealname;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 管理员用户信息表 前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class AdUserController {

    @Autowired
    private AdUserService adUserService;

    @PostMapping("/login/in")
    public ResponseResult login(@RequestBody AdUserDto dto){
        return adUserService.login(dto);
    }
    @PostMapping("/api/v1/auth/list")
    public ResponseResult pageList(@RequestBody AuthDto dto){
        return adUserService.pageList(dto);
    }
    @PostMapping("/api/v1/auth/authFail")
    public ResponseResult authFail(@RequestBody AuthDto dto){
        return adUserService.authFail(dto);
    }
    @PostMapping("/api/v1/auth/authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto){
        return adUserService.authPass(dto);
    }
}
